home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Format (UK) 188
/
01-04 PC Format 188 [2006-06] DVD side 1_.iso
/
Menus
/
Scenes
/
HOME.dir
/
00008_Script_SubMenuButtonHandler
< prev
next >
Wrap
Text File
|
2006-04-20
|
3KB
|
130 lines
property Sp
property myList
property myTxtSp
property clicked
global mKey
global SubStartChannel
global cList
on init me, aListEntry
Sp = sprite(me.spritenum)
myTxtSp = sprite(sp.spritenum + 1)
myList = aListEntry
clicked = false
end
on mouseEnter me
cursor 280
myTxtSp.member.color = rgb(193,24,29)
Sp.member = member("button_Over")
end
on mouseLeave me
if clicked = false then
myTxtSp.member.color = rgb(0,0,0)
sp.member = member("button")
cursor -1
end if
end
on Unclick_SubMenu me, aSpritenum
clicked = false
if aSpritenum <> Sp.spritenum then
myTxtSp.member.color = rgb(0,0,0)
sp.member = member("button")
cursor -1
end if
end
on mouseUp me
if clicked = false then
sendAllsprites(#Unclick_SubMenu, Sp.spritenum)
clicked = true
pLocV = Sp.locV
pLocH = Sp.right
pPoint = point(Sp.right, 110)
b = member("item_button")
b.regpoint = point(0,0)
member("Item_Button_Over").regpoint = point(0,0)
bh = b.height
bw = b.width
chn = cList.itemMenu[1]
clearScriptedSprites(cList.itemmenu)
repeat with d = 1 to castlib("Item_Menu_Text").member.count
member(d, 5).erase()
end repeat
repeat with i = 1 to myList.pItem.count
if i = 11 then
--
chn = chn + 1
channel(chn).makescriptedsprite(member("glass_button_bottom"), pPoint)
chn = chn +1
pPoint.loch = pPoint.loch + bw
pPoint.locV = 110
end if
channel(chn).makescriptedsprite(b, pPoint)
sc = script("Item_Button_Handler").new()
sprite(chn).scriptinstanceList.add(sc)
sendsprite(chn, #init, myList.pItem[i])
chn = chn + 1
nt = new(#text, castlib 5)
nt.text = myList.pItem[i].pTitle
nt.antialias = true
nt.antialiasthreshold = 0
nt.color = rgb(0,0,0)
nt.width = bw
nt.fontstyle = [#bold]
nt.fontsize = 12
txtLoc = pPoint + point(10,8)
channel(chn).makescriptedsprite(nt, txtLoc)
sprite(chn).ink = 36
chn = chn + 1
pPoint.locV = pPoint.locV + bh
end repeat
chn = chn + 1
channel(chn).makescriptedsprite(member("glass_button_bottom"), pPoint)
chn = chn +1
pPoint.loch = pPoint.loch + bw
pPoint.locV = 110
else
clicked = false
clearScriptedSprites(cList.itemmenu)
myTxtSp.member.color = rgb(0,0,0)
sp.member = member("button")
cursor -1
end if
end